package cn.dtsmusic.test;

import java.io.IOException;
import java.net.URLDecoder;
import java.net.URLEncoder;

public class UrlEncoder {

	public static void main(String[] args) throws IOException {
		
		//转换成普通字符串
		 String keyWord = URLDecoder.decode("%E7%BD%91%E7%BB%9C%E6%97%B6%E7%A9%BA", "UTF-8");
				  System.out.println(keyWord);
				  
	  //将普通字符串转换成
	  //application/x-www-form-urlencoded字符串
	  String urlStr = URLEncoder.encode("网络时空" , "UTF-8");
	  System.out.println(urlStr);
				  
	}
}
